JIIT Placement Alerts

Documentation

Back to Home
Home Projects JIIT Placement Alerts Getting Started

Getting Started

Table of Contents#

  1. Introduction

  2. Quick Start: Live Bot Usage

  3. Self-Hosted Setup

  4. Prerequisites

  5. Installation Steps

  6. Initial Configuration

  7. Environment Variables

  8. Basic Command Usage

  9. Architecture Overview

  10. Verification Checklist

  11. Troubleshooting Common Issues

  12. Next Steps

Introduction#

The SuperSet Telegram Notification Bot is a placement notification system for JIIT students. It aggregates job postings, placement offers, and placement updates from JIIT’s SuperSet portal, email sources, and official websites, then distributes them via Telegram and Web Push channels. The system includes automated scraping, LLM-powered content processing, and multi-channel notifications.

Key capabilities:

  • Automated scraping of SuperSet portal, emails, and official websites

  • Smart duplicate detection to prevent repeated notifications

  • LLM-powered extraction and structuring of placement data

  • Multi-channel broadcasting (Telegram and Web Push)

  • User management with simple commands (/start, /stop, /status)

  • Scheduled updates (3x daily IST)

  • Admin dashboard and daemon mode for production deployments

Quick Start: Live Bot Usage#

No setup required! The bot is already running and ready to use:

Steps:

  1. Open Telegram and search for @SupersetNotificationBot

  2. Send /start to register for notifications

  3. You’ll receive updates via Telegram automatically

  4. Use /help to see all available commands

Self-Hosted Setup#

For advanced users who want to run their own instance, follow these steps:

Prerequisites#

  • Python: 3.12 or higher

  • MongoDB: Local or Atlas (cloud)

  • Telegram Bot: Created via @BotFather

  • Email Account: Gmail with app password (for email monitoring)

  • API Key: Google API key for Gemini (optional, for LLM features)

Installation Steps#

1. Clone Repository#

bash
git clone https://github.com/tashifkhan/placement-alerts-superset-telegram-notification-bot.git
cd placement-alerts-superset-telegram-notification-bot

2. Install Dependencies#

bash
cd app

# Using uv (recommended)
pip install uv
uv sync

# OR using pip
pip install -r requirements.txt

3. Get Credentials#

Telegram Bot Token:

  1. Open Telegram and search for @BotFather

  2. Send /newbot

  3. Follow the prompts and copy your token

Chat ID:

  • Message @userinfobot to get your user ID

  • Or use the getUpdates API endpoint for group/channel IDs

MongoDB Connection String:

  1. Create free account at MongoDB Atlas

  2. Create a cluster

  3. Click “Connect” → “Connect Your Application”

  4. Copy the connection string

Gmail App Password:

  1. Enable 2-factor authentication on Google Account

  2. Go to myaccount.google.com/apppasswords

  3. Generate password for “Mail” and “Windows Computer”

  4. Copy the 16-character password

4. Configure Environment#

Create .env file in the app/ directory:

bash
# MongoDB
MONGO_CONNECTION_STR=mongodb+srv://username:password@cluster.mongodb.net/SupersetPlacement

# Telegram
TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
TELEGRAM_CHAT_ID=987654321

# SuperSet Credentials (JSON format)
SUPERSET_CREDENTIALS=[{"email": "cse_email@jiit.ac.in", "password": "password"}]

# Email & Gmail
PLACEMENT_EMAIL=your_gmail@gmail.com
PLACEMENT_PASSWORD=your_app_password
GOOGLE_API_KEY=your_google_api_key

# Optional
DEBUG=false

5. Run the Bot#

bash
# Run in foreground (development)
python main.py bot

# Run in background (daemon mode - production)
python main.py bot --daemon

# Run one-time update
python main.py update

# Send pending notifications
python main.py send --telegram

# Start webhook server
python main.py webhook --port 8000

Architecture Overview#

The application follows a service-oriented architecture with dependency injection:

graph TB subgraph "Data Sources" SS[SuperSet Portal] GM[Gmail/Emails] OW[Official Website] end subgraph "Service Layer" SC[SupersetClientService] PS[PlacementService] ENS[EmailNoticeService] NFS[NoticeFormatterService] SSC[SupersetScraperClient] end subgraph "Storage" DB[(MongoDB)] NC[Notices Collection] JC[Jobs Collection] PC[PlacementOffers Collection] UC[Users Collection] end subgraph "Notification Channels" TS[Telegram Bot Server] WS[Web Push Service] end SS --> SC GM --> ENS OW --> SSC SC --> NFS ENS --> NFS NFS --> DB SSC --> DB DB --> TS DB --> WS

Diagram sources

Environment Variables#

The application uses Pydantic’s BaseSettings for type-safe configuration. All configuration is managed through environment variables loaded from a .env file.

Required Variables#

  • Database: MONGO_CONNECTION_STR - MongoDB connection URI

  • Telegram: TELEGRAM_BOT_TOKEN - API Token from @BotFather, TELEGRAM_CHAT_ID - Channel or Chat ID

  • SuperSet Credentials: SUPERSET_CREDENTIALS - JSON list of SuperSet credentials

  • Email Intelligence: PLACEMENT_EMAIL - Gmail address, PLACEMENT_PASSWORD - Gmail App Password, GOOGLE_API_KEY - Google API Key

Optional Variables#

  • Web Push: VAPID_PRIVATE_KEY, VAPID_PUBLIC_KEY, VAPID_EMAIL

  • Server Configuration: WEBHOOK_PORT, WEBHOOK_HOST

  • Daemon Mode: DAEMON_MODE

  • Logging: LOG_LEVEL, LOG_FILE, SCHEDULER_LOG_FILE

Section sources

Basic Command Usage#

The application is controlled via a unified CLI entry point main.py.

Available Commands#

  • bot - Starts the Telegram Bot server (commands only)

  • scheduler - Runs scheduled update jobs server

  • webhook - Starts the FastAPI Webhook server

  • update - Full update: SuperSet + Emails (Placements + Notices)

  • send - Sending engine (dispatch pending messages)

  • official - Runs the official website scraper

Command Options#

  • --daemon - Run in daemon mode (suppress stdout)

  • --telegram - Via Telegram

  • --web - Via Web Push

  • --both - Via both channels

  • --fetch - Fetch first before sending

  • --host - Host for webhook server

  • --port - Port for webhook server

Section sources

Verification Checklist#

Before you begin, verify your environment meets all requirements:

1. Prerequisites Verification#

2. Environment Setup#

3. Initial Testing#

4. Production Readiness#

Troubleshooting Common Issues#

Bot Not Receiving Messages#

Symptoms: Commands not responding, users not registering Common Causes:

  • Bot server not running

  • Long-polling vs Webhook confusion

  • User not registered

  • Chat ID mismatch

Solutions:

  1. Verify bot server is running: ps aux | grep main.py | grep bot

  2. Check command format: /start (lowercase, no spaces)

  3. Verify TELEGRAM_CHAT_ID format (numeric only)

  4. Test manually with curl: curl -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$TELEGRAM_CHAT_ID&text=Test"

Database Connection Issues#

Symptoms: Connection timeout, authentication failed Common Causes:

  • Invalid connection string format

  • IP whitelist not configured

  • Incorrect credentials

  • Firewall blocking port 27017

Solutions:

  1. Check connection string format: mongodb+srv://user:pass@cluster.mongodb.net/db

  2. Add IP to MongoDB Atlas whitelist

  3. URL-encode special characters in passwords

  4. Test connectivity: telnet cluster.mongodb.net 27017

Email Processing Problems#

Symptoms: Emails not being processed, offers not extracted Common Causes:

  • Gmail App Password incorrect

  • 2-Factor Authentication not enabled

  • LLM not working

  • Email format not recognized

Solutions:

  1. Regenerate app password at myaccount.google.com/apppasswords

  2. Enable 2-Step Verification in Google Account

  3. Check GOOGLE_API_KEY format (should start with AIzaSy)

  4. Test email processing manually

Notification Delivery Issues#

Symptoms: Notices processed but not sent to Telegram Common Causes:

  • sent_to_telegram flag already true

  • Telegram service connection issue

  • Chat ID not valid

  • Message too long

Solutions:

  1. Check and reset sent flags if needed

  2. Test Telegram API connectivity

  3. Verify chat ID format (all numeric with optional minus)

  4. Check message length (Telegram has 4096 character limit)

Section sources

Next Steps#

Once your bot is running successfully:

1. Monitor Operations#

  • Set up logging and monitoring

  • Configure alerts for critical errors

  • Monitor database performance

  • Track user engagement metrics

2. Scale and Customize#

  • Add more data sources

  • Implement user filtering options

  • Enhance notification templates

  • Add analytics dashboard

3. Maintenance#

  • Regular database backups

  • Update credentials periodically

  • Monitor service health

  • Review and optimize performance

4. Community#

  • Share your deployment experience

  • Contribute improvements

  • Report bugs and issues

  • Help other users deploy

The bot is designed for both personal use and production deployment. Start with the live bot for immediate use, then consider self-hosting for customization and privacy requirements.